package image;


import com.agitar.lib.junit.AgitarTestCase;

import image.Image;
import image.ImageCache;

import java.util.Map;

public class ImageCacheAgitarTest extends AgitarTestCase {
    static Class TARGET_CLASS = ImageCache.class;
    
    public void testConstructor() throws Throwable {
        ImageCache imageCache = new ImageCache();
        assertEquals("imageCache.sprites.size()", 0, ((Map) getPrivateField(imageCache, "sprites")).size());
    }
    
    public void testClear() throws Throwable {
        ImageCache cache = ImageCache.getCache();
        cache.clear();
        assertEquals("cache.sprites.size()", 0, ((Map) getPrivateField(cache, "sprites")).size());
    }
    
    public void testGetCache() throws Throwable {
        ImageCache result = ImageCache.getCache();
        assertNotNull("result", result);
    }
    
    public void testGetSprite() throws Throwable {
        ImageCache cache = ImageCache.getCache();
        Image sprite = cache.getSprite("");
        Image result = cache.getSprite("");
        assertSame("result", sprite, result);
    }
    
    public void testGetSprite1() throws Throwable {
        ImageCache imageCache = new ImageCache();
        Image result = imageCache.getSprite("");
        assertEquals("imageCache.sprites.size()", 1, ((Map) getPrivateField(imageCache, "sprites")).size());
    }
    
    public void testResize() throws Throwable {
        ImageCache.getCache().resize(100, 1000);
        assertTrue("Test completed without Exception", true);
    }
}

